/**  File: wall.cpp
 *   Author: Jaideep Balekar
 *           Department of Computer Science
 *           Texas A&M University
 *           315 - Programming Studio
 * Due Date: December 6th, 2009 @ 11:59pm
 * Contents: This class draws the walls on the map and sets its properties
			 Creates, loads the scene and add items
 */


#include "wall.h"

#include <QGraphicsScene>
#include <QPainter>
#include <QStyleOption>

//Constructor 
Wall::Wall()
{
    color = QColor(0,0,255,255); //blue
    pencolor = QColor(0,0,0,0);
}

int Wall::type() const
{
    return ID_WALL; //this will return 0, indidcating wall
}


//Making bouding rectangle around the wall to help collision detection
QRectF Wall::boundingRect() const
{
    return QRectF(0,0,WIDTH,HEIGHT);
}

//Drawing a rectangle of dimensions (WIDTH, HEIGHT)
void Wall::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{   
   painter->setBrush(color);
   painter->setPen (pencolor);
   painter->drawRect(0,0, WIDTH, HEIGHT);

}



